//DONE

public class TwoSquares
{
   public static int nWays(int k)
   {
      int number = k;
      int ways = 0;
      int limit = (int) Math.sqrt(number);
            
      for(int i=0;i<=limit;i++)
      {
         for(int j=i;j<=limit;j++)
         {
            int twosq = i*i+j*j;
            if(twosq == number)
            {
               ways++;
               break;
            }
            
         }
      }
      return ways;
   }

}
